using UnityEngine;
using System.Collections;
using AforgeFramework;
using System.Threading;


public class LoadingNeural : MonoBehaviour
{

    #region Atributos

    private Sprite2D _backgroundLoading;
    private TestClass _neural;

    Thread _thread;

    #endregion 

    // Use this for initialization
	void Start () 
    {
        Debug.Log("quase Treinando");
        
        
        //StartCoroutine(TrainNeural());	

        _thread = new Thread(TrainNeural);
        _thread.Start();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void OnGUI()
    {
        //_backgroundLoading.Draw();
    }


    void TrainNeural()
    {
        
       _neural = new TestClass();
       _neural.TrainNetwork();
       double[] entrada = new double[1];

        //Life - Time
       entrada = new double[1]; entrada[0] = 20;

        Debug.Log(_neural.Recognize(entrada));   
    }

    //IEnumerator TrainNeural()
    //{

    //    //Debug.Log("Treinando...");
       
    //    //_neural.TrainNetwork();
       
    //    Application.LoadLevel("GameScene");

    //    yield return true;
    //}
}
